package pers.muci.es;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

import java.io.IOException;

/**
 * @ClassName ESClient
 * @Description es 客户端
 * @Author muci
 * @Date 2021/12/21 21:32
 * @Version 1.0
 **/
public class ESClient {
    public static void main(String[] args) throws IOException {
        //创建es客户端
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(new HttpHost("106.14.15.56", 9200, "http"))
        );

        client.close();
    }
}
